HopeTIME / [timerd][教授与疯子][支持庆余年] 腾讯、爱奇艺、芒果、优酷、乐视、B站、土豆、搜狐、1905等 VIP视频免费看(2019-12-23)更新新

// ==UserScript==
// @name       [timerd][教授与疯子][支持庆余年] 腾讯、爱奇艺、芒果、优酷、乐视、B站、土豆、搜狐、1905等 VIP视频免费看(2019-12-23)更新新
// @namespace    http://timerd.ml
// @version      2019.12.23
// @description  腾讯、爱奇艺、芒果、优酷、乐视、B站、土豆、搜狐、1905等各大视频网站视频解析服务(有谷歌ads)
// @author       timerd
// @include      *://v.youku.com/v_*
// @include      *://m.youku.com/v*
// @include      *://m.youku.com/a*
// @include      *://*.iqiyi.com/v_*
// @include      *://*.iqiyi.com/w_*
// @include      *://*.iqiyi.com/a_*
// @include      *://*.iqiyi.com/dianying/*
// @include      *://*.le.com/ptv/vplay/*
// @include      *://*v.qq.com/x/cover/*
// @include      *://*v.qq.com/x/page/*
// @include      *://*v.qq.com/play*
// @include      *://*v.qq.com/cover*
// @include      *://*.tudou.com/listplay/*
// @include      *://*.tudou.com/albumplay/*
// @include      *://*.tudou.com/programs/view/*
// @include      *://*.tudou.com/v*
// @include      *://*.mgtv.com/b/*
// @include      *://film.sohu.com/album/*
// @include      *://tv.sohu.com/*
// @include      *://*.bilibili.com/video/*
// @include      *://*.bilibili.com/anime/*
// @include      *://*.bilibili.com/bangumi/play/*
// @include      *://*.pptv.com/show/*
// @include      *://*.baofeng.com/play/*
// @include      *://*.wasu.cn/Play/show*
// @include      *://*.1905.com/play/*
// @require      http://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @grant        GM_openInTab
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @grant        unsafeWindow
// @grant        GM_getResourceURL
// @grant        GM_getResourceText
// @license      MIT
// ==/UserScript==
(function () {

    'use strict'
    // Define region
    //-------------------------------------------------------------
    function addInfrastructure() {
        let style = document.createElement("style");
      
        style.appendChild(document.createTextNode(`
              #mywidget a {
              position: absolute;
              left: -75px;
              transition: 0.3s;
              padding: 15px 30px 15px 15px; 
              text-decoration: none;
              color: white!important;
              border-radius: 0 8px 8px 0;
              font: 20px "Microsoft YaHei",SimHei,helvetica,arial,verdana,tahoma,sans-serif;
              min-width: 80px;
              text-align:right;
              white-space:nowrap;             
            }


            #mywidget a:hover {
                left: 0;
             }    
   
             #vparse {
               background-color: #f44336;
             }

             #myplaybutton {
                 position:absolute; 
                 right:-8px;
                 top: 14px; 
                 width:0px;
                 height:0px;
                 margin:0px;
                 border-width: 16px;
                 border-style: solid;
                 border-color:transparent transparent transparent white;
             }

             #mywidget a img {
             width: 28px;
             height:34px;
             position: absolute;
             top:12px;
             right: 5px;
             align-items: center;
       }`));        

        document.head.appendChild(style);
    }

    //-------------------------------------------------------------
    let playurl = window.location.href;
    let rArray = playurl.split('?');
    let cWeb = rArray[0];
    const vSite = /m1907.cn/i;
    //-------------------------------------------------------------

    // Little tricks 
    if (vSite.test(cWeb)) {
        window["alert"] = function (e) { };     
        return;
    }
    //------------------------------------------------------------

    //add a button to current website.    
    const vWebsites = new Array();
    vWebsites[0] = /youku.com/i;
    vWebsites[1] = /iqiyi.com/i;
    vWebsites[2] = /le.com/i;
    vWebsites[3] = /qq.com/i;
    vWebsites[4] = /tudou.com/i;
    vWebsites[5] = /mgtv.com/i;
    vWebsites[6] = /sohu.com/i;
    vWebsites[7] = /1905.com/i;
    vWebsites[8] = /bilibili.com/i;
    vWebsites[9] = /pptv.com/i;
    vWebsites[10] = /baofeng.com/i;
    vWebsites[11] = /yinyuetai.com/i;
    vWebsites[12] = /wasu.cn/i;
    vWebsites.every((item) => {
        if (item.test(cWeb)) {
            addInfrastructure();
            var jumpButton = $(`
            <div id="mywidget" href='javascript:void(0)' target='_blank' style="z-index:9999; position:fixed;left:0px;top:280px;">    
                <a href="#" id="vparse">视频解析 <div id="myplaybutton"></div></a>
            </div>
            `);
           
            $("body").append(jumpButton);
    
            // bind onclick event
            $("#mywidget").click(function () {
                var openUrl = window.location.href;
                window.open('https://chinese-elements.com/static/v.html?zwx=' + openUrl);
            });
            return false;
        }
        return true;
    });

})();